<?php
class Login
{
    public function register($arr)
    {
		global $db;
		if ($db->count('game_user', "user_name = '{$arr['username']}'") > 0) {
			return '用户名已存在';
		}
		$arrInsert = array (
				'user_name' => $arr['username'],
				'password' => md5($arr['password']),
			);
		if ($db->insert('game_user', $arrInsert))
			$result = '注册成功';
		else
			$result = '注册失败';
        return $result;
    }


}
?>